home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / mutt / me2s_pl7.zoo / mu_edit2 / util / util.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-05  |  2.0 KB  |  67 lines

  1. /* $Id: util.h,v 1.1 1992/09/06 19:31:32 mike Exp $ */
  2.  
  3. /* $Log: util.h,v $
  4.  * Revision 1.1  1992/09/06  19:31:32  mike
  5.  * Initial revision
  6.  *
  7.  */
  8.  
  9. /* util.h: header file for utilities and stuff that uses utilities
  10.  * C Durland    Public Domain
  11.  */
  12.  
  13. #ifndef __UTIL_H_INCLUDED
  14. #define __UTIL_H_INCLUDED
  15.  
  16. #define CAD    /* Craig's stuff is available */
  17.  
  18. /* ***************************************************************** */
  19. /* ************** files and file io ******************************** */
  20. /* ***************************************************************** */
  21.  
  22. #define STDIN 0
  23. #define STDOUT 1
  24. #define STDERR 2
  25.  
  26. /* ***************************************************************** */
  27. /* ************** spew stuff *************************************** */
  28. /* ***************************************************************** */
  29.  
  30. #define crlf() write(STDOUT,"\r\n",2)
  31. #define fspews(string,filedes) write(filedes,string,strlen(string)) /* fputs*/
  32. #define spew(string) fspews(string,STDOUT) /* puts with no added \n */
  33. #define spewj(string,width,left_just) fspewj(STDOUT,string,width,left_just)
  34.  
  35. #ifdef USESPEW
  36. #define printf spewf
  37. #define putchar spewc
  38. #define puts spews
  39. #endif
  40.  
  41. /* ***************************************************************** */
  42. /* ************** time and date ************************************ */
  43. /* ***************************************************************** */
  44.  
  45. typedef struct
  46. {
  47.   int month, day, weekday, year;  /* year is 4 digits. year%100 for last 2 */
  48.   int hh, mm, ss;
  49. } TIMEDATE;
  50.  
  51. /* ***************************************************************** */
  52. /* ************** misc handi stuff ********************************* */
  53. /* ***************************************************************** */
  54.  
  55. #define cm_to_i(cm) ((cm)/2.54)
  56. #define i_to_cm(inches) ((inches)*2.54)
  57.  
  58. #ifndef PI
  59. #define PI 3.14159265
  60. #endif
  61.  
  62.     /* convert degrees to radians and vice versa */
  63. #define d_to_r(angle) ((angle)*PI/180.0)
  64. #define r_to_d(angle) ((angle)*180.0/PI)
  65.  
  66. #endif    /* __UTIL_H_INCLUDED */
  67.